package model

import jwt "github.com/dgrijalva/jwt-go"

// User 用户表
type UserLogin struct {
	Id        int    `json:"id" form:"id"`
	Sno       string `json:"sno" form:"sno"`
	Password  string `json:"password" form:"password"`
	Ismanager string `json:"ismanager" form:"ismanager"`
}

// Login 用户登陆
func Login(sno string) (*UserLogin, error) {
	// print(sno)
	mod := &UserLogin{
		Sno: sno,
	}
	// print(mod.Sno)
	err := DB.Get(mod, "select * from `login` where `sno`=?", mod.Sno)
	//SELECT * FROM `class` WHERE `cid`=?
	return mod, err
}

// Jwt json web token
type Jwt struct {
	Id        int
	Sno       string
	Ismanager string
	jwt.StandardClaims
}
